/**
 * @date 2006-1-17 16:04:45
 *
 */
package org.nanhill.xsheet.output.excel;

import static org.nanhill.commons.html.CssColor.AQUA;
import static org.nanhill.commons.html.CssColor.BLACK;
import static org.nanhill.commons.html.CssColor.BLUE;
import static org.nanhill.commons.html.CssColor.BROWN;
import static org.nanhill.commons.html.CssColor.CORAL;
import static org.nanhill.commons.html.CssColor.GOLD;
import static org.nanhill.commons.html.CssColor.GREEN;
import static org.nanhill.commons.html.CssColor.INDIGO;
import static org.nanhill.commons.html.CssColor.LAVENDER;
import static org.nanhill.commons.html.CssColor.LIME;
import static org.nanhill.commons.html.CssColor.MAROON;
import static org.nanhill.commons.html.CssColor.ORANGE;
import static org.nanhill.commons.html.CssColor.ORCHID;
import static org.nanhill.commons.html.CssColor.PINK;
import static org.nanhill.commons.html.CssColor.PLUM;
import static org.nanhill.commons.html.CssColor.RED;
import static org.nanhill.commons.html.CssColor.ROSE;
import static org.nanhill.commons.html.CssColor.TAN;
import static org.nanhill.commons.html.CssColor.TEAL;
import static org.nanhill.commons.html.CssColor.TURQUOISE;
import static org.nanhill.commons.html.CssColor.VIOLET;
import static org.nanhill.commons.html.CssColor.WHITE;
import static org.nanhill.commons.html.CssColor.YELLOW;
import static org.nanhill.commons.html.CssTag.CENTER;
import static org.nanhill.commons.html.CssTag.JUSTIFY;
import static org.nanhill.commons.html.CssTag.LEFT;
import static org.nanhill.commons.html.CssTag.RIGHT;

import java.util.HashMap;
import java.util.Map;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.util.HSSFColor;

/**
 * @author alin
 * 
 */
public class Xhtml2Hssf {
	private static final Map<String, Short> colorMap;

	private static final Map<String, Short> positionMap;

	static {
		colorMap = new HashMap<String, Short>();
		colorMap.put(YELLOW, HSSFColor.YELLOW.index);
		colorMap.put(RED, HSSFColor.RED.index);
		colorMap.put(BLUE, HSSFColor.BLUE.index);
		colorMap.put(PINK, HSSFColor.PINK.index);
		colorMap.put(GREEN, HSSFColor.GREEN.index);
		colorMap.put(BROWN, HSSFColor.BROWN.index);
		colorMap.put(BLACK, HSSFColor.BLACK.index);
		colorMap.put(INDIGO, HSSFColor.INDIGO.index);
		colorMap.put(ORANGE, HSSFColor.ORANGE.index);
		colorMap.put(TEAL, HSSFColor.TEAL.index);
		colorMap.put(LIME, HSSFColor.LIME.index);
		colorMap.put(AQUA, HSSFColor.AQUA.index);
		colorMap.put(VIOLET, HSSFColor.VIOLET.index);
		colorMap.put(GOLD, HSSFColor.GOLD.index);
		colorMap.put(TURQUOISE, HSSFColor.TURQUOISE.index);
		colorMap.put(PLUM, HSSFColor.PLUM.index);
		colorMap.put(ROSE, HSSFColor.ROSE.index);
		colorMap.put(TAN, HSSFColor.TAN.index);
		colorMap.put(LAVENDER, HSSFColor.LAVENDER.index);
		colorMap.put(WHITE, HSSFColor.WHITE.index);
		colorMap.put(MAROON, HSSFColor.MAROON.index);
		colorMap.put(ORCHID, HSSFColor.ORCHID.index);
		colorMap.put(CORAL, HSSFColor.CORAL.index);
	}

	static {
		positionMap = new HashMap<String, Short>();
		positionMap.put(LEFT, HSSFCellStyle.ALIGN_LEFT);
		positionMap.put(CENTER, HSSFCellStyle.ALIGN_CENTER);
		positionMap.put(RIGHT, HSSFCellStyle.ALIGN_RIGHT);
		positionMap.put(JUSTIFY, HSSFCellStyle.ALIGN_JUSTIFY);
	}

	public static Map<String, Short> getColorMap() {
		return colorMap;
	}

	public static Map<String, Short> getPositionMap() {
		return positionMap;
	}

}
